/*
 * StringConcat.h
 *
 *	Author: stravant
 *	Description:
 *		
 */

#ifndef STRINGCONCAT_H_
#define STRINGCONCAT_H_

#include <string>
#include <sstream>

class StringBuilder {
private:
	std::stringstream mBuff;

public:
	void clear() {
		mBuff.clear();
	};

	template <class T>
	void append(const T& element) {
		mBuff << element;
	};

	operator std::string() const {
		return mBuff.str();
	};

	template <class T>
	StringBuilder &operator<<(const T& se) {
		append(se);
		return *this;
	};

	operator const char *() const {
		return mBuff.str().c_str();
	};
};

#endif /* STRINGCONCAT_H_ */
